	package com.live.dengdengtv.utils;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;

public class Notice {

	public static void alert(Context context, String message) {
		alert(context, message, null);
	}

	public static void alert(Context context, String message,
			final OnClickListener listener) {
		new AlertDialog.Builder(context).setTitle("提示").setMessage(message)
				.setPositiveButton("确定", listener).show();
	}

	public static void alert(Context context, String message,
			String buttonText, final OnClickListener listener) {
		new AlertDialog.Builder(context).setTitle("提示").setMessage(message)
				.setPositiveButton(buttonText, listener).show();
	}
	
	public static void alert(Context context, String message,
			String buttonLeft, final OnClickListener listenerL, String buttonRight, final OnClickListener listenerR) {
		new AlertDialog.Builder(context).setTitle("提示").setMessage(message)
		.setPositiveButton(buttonLeft, listenerL)
		.setNegativeButton(buttonRight, listenerR).show();
	}

	public static void alertAndFinish(final Context context, String message) {
		new AlertDialog.Builder(context).setTitle("提示").setMessage(message)
				.setPositiveButton("确定", new OnClickListener() {
					@Override
					public void onClick(DialogInterface dialog, int which) {
						((Activity) context).finish();
					}
				}).show();
	}

	public static void confirm(Context context, String message,
			final OnClickListener yesListener,
			final OnClickListener cancelListener) {
		new AlertDialog.Builder(context).setTitle("提示").setMessage(message)
				.setPositiveButton("确定", yesListener)
				.setNegativeButton("取消", cancelListener).show();
	}
}
